{% extends "base.html" %}
{% load django_bootstrap5 origin %}

{% block morecss %}
  #preview { width: 100%; height: 60vh; border: solid 2px; }
{% endblock %}

{% block title %}
  Import Preview: {% firstof note.get_title note.id %}
{% endblock %}

{% block content %}
  {% origin %}
  <h1>Import Preview: {% firstof note.get_title note.id %}</h1>
  <div class="row">
    <div class="col-md-11">
      <p class="pull-left">Last updated: {% firstof note.get_update_time "unknown" %}</p>
      <p class="pull-right"><a href="{{ note.url }}">View on notes.ietf.org</a></p>
      <iframe title="Import preview" id="preview" srcdoc="{{ note.get_preview|force_escape }}" sandbox>
      </iframe>
    </div>
  </div>
  <div class="row">
    <div class="col-md-11">
      <form method="post" enctype="multipart/form-data">
        {% csrf_token %}
        {% bootstrap_form form %}
        {% bootstrap_button "Import" button_type="submit" disabled=contents_unchanged %}
        {% url 'ietf.meeting.views.session_details' num=session.meeting.number acronym=session.group.acronym as back_url %}
        {% bootstrap_button "Back" button_type="link" href=back_url %}
      </form>
    </div>
  </div>
{% endblock %}